var p_gb = function () {
    p1 = images.findMultiColors(
        images.captureScreen(),
        '#FFEFB2',
        [
            [-5, 0, '#B4A17B'],
            [0, -4, '#6A654C'],
            [5, 0, '#766C55'],
            [0, 5, '#766D54'],
            [-8, 10, '#FFF4B2'],
            [-8, -8, '#F2DFA8'],
            [9, -8, '#F2DFA8'],
            [9, 8, '#FEEFB1'],
        ],
        { threshold: 25.5, region: [625, 0, 650, 490] }
    );
    p2 = images.findMultiColors(
        images.captureScreen(),
        '#FFEA99',
        [
            [-10, -10, '#F1D882'],
            [10, -10, '#ECCC7E'],
            [10, 10, '#F8F0A8'],
            [-10, 10, '#F0F0A0'],
            [-14, 24, '#FAFAFA'],
            [-8, 23, '#FFFFFF'],
            [-18, 32, '#D8D8D8'],
            [-4, 31, '#FCFCFC'],
            [-17, 38, '#F7F7F7'],
            [15, 38, '#FEFEFE'],
            [15, 24, '#FEFEFE'],
        ],
        { threshold: 25.5, region: [1152, 5, 122, 83] }
    );
    p = p1 ? p1 : p2; //p1方角关闭 p2尖角关闭
    if (p) {
        return { x: p.x, y: p.y, nm: '关闭' };
    } else {
        return { x: 5, y: 5, nm: '关闭' };
    }
};
var p_zjm = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#E56E46',
        [
            [0, 9, '#E56E46'],
            [0, 17, '#47A1C7'],
            [0, 23, '#47A1C7'],
            [-64, 447, '#FBF1D0'],
            [-51, 479, '#ECD7B7'],
            [-60, 619, '#EFDCBC'],
            [317, 565, '#DCD3C6'],
            [429, 569, '#DCD3C6'],
            [821, 5, '#F2E2C2'],
            [759, -5, '#F8EDCB'],
            [677, -16, '#FDF7D7'],
        ],
        { threshold: 25.5 }
    );

    if (p) {
        return { x: p.x, y: p.y, nm: '主界面' };
    } else {
        return { x: 5, y: 5, nm: '主界面' };
    }
};
var p_hd = function () {
    if (storage.get('configure').hd_by) {
        p = findText('活动', [659, 12, 466, 77], 'e');
        if (p) {
            return { x: Number(p[0].x), y: Number(p[0].y) - 20, nm: p[0].text };
        } else {
            return { x: 5, y: 5, nm: '活动' };
        }
    } else {
        p1 = images.findMultiColors(
            images.captureScreen(),
            '#F7EEDB',
            [
                [0, 3, '#EFDDBD'],
                [4, 6, '#F4DEBD'],
                [4, 12, '#EFD7BA'],
                [6, 13, '#EFD7BA'],
                [9, 11, '#E9DEBD'],
                [21, 1, '#F4E9C8'],
                [22, 7, '#EEDABA'],
                [-17, -4, '#F7E7C6'],
                [14, -10, '#FFEECC'],
                [-754, -6, '#E56E46'],
                [-754, 6, '#E56E46'],
                [-815, 613, '#EFDDBD'],
                [228, -6, '#EEE2C9'],
                [256, -8, '#F6E6CA'],
                [268, -7, '#F0E0C4'],
            ],
            { threshold: 25.5 }
        ); //晴
        p2 = images.findMultiColors(
            images.captureScreen(),
            '#F0DEBF',
            [
                [6, 10, '#E8D2B6'],
                [22, 2, '#E9D7B8'],
                [-8, -25, '#FBEED4'],
                [-14, 19, '#F5F0DE'],
                [-11, 15, '#FDF8E5'],
                [-13, 28, '#F5F0DE'],
                [8, 22, '#F8F3E1'],
                [19, 18, '#FDF8E5'],
                [254, -6, '#F7E7C9'],
                [-81, 629, '#DCD3C6'],
                [-755, 5, '#E56E46'],
                [-755, -7, '#E56E46'],
                [-658, 533, '#F2E5B3'],
            ],
            { threshold: 25.5 }
        ); //雪
        p = p1 ? p1 : p2;
        if (p) {
            return { x: p.x, y: p.y, nm: '活动' };
        } else {
            return { x: 5, y: 5, nm: '活动' };
        }
    }
};
var p_hdz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#413214',
        [
            [4, 6, '#ECE4C0'],
            [4, -13, '#453515'],
            [4, 17, '#ECE4C2'],
            [11, 22, '#ECE4C2'],
            [-13, 12, '#EFE0A8'],
            [-22, 6, '#3F3113'],
            [-34, -2, '#FDE79D'],
            [-25, -11, '#443515'],
            [-17, -24, '#D0BD7A'],
            [-2, -38, '#D1BD76'],
            [-1, -31, '#867648'],
            [22, -25, '#D6C48B'],
            [31, -7, '#F0E8C7'],
            [42, 7, '#EAE2C0'],
            [62, 14, '#EEE6C4'],
            [52, 6, '#463615'],
            [52, -4, '#4B3917'],
            [89, 4, '#EEE6C4'],
        ],
        { threshold: 25.5, region: [5, 7, 155, 96] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '活动字' };
    } else {
        return { x: 5, y: 5, nm: '活动字' };
    }
};
var p_ssltk = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F6E6CA',
        [
            [-3, -3, '#F7E7C9'],
            [3, -3, '#F7E7C9'],
            [0, 8, '#F6E6C9'],
            [0, 11, '#E0CEB5'],
            [-12, -1, '#F0E0C4'],
            [-8, -1, '#F6E6C9'],
            [8, -1, '#F7E7C9'],
            [12, -1, '#F1E1C3'],
            [-670, -556, '#E56E46'],
            [-670, -544, '#E56E46'],
            [-243, -40, '#DCD3C6'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '收缩聊天框' };
    } else {
        return { x: 5, y: 5, nm: '收缩聊天框' };
    }
};

var p_r = {
    pause_flag: false,
    setPauseFlag: function () {
        p_r.pause_flag = !p_r.pause_flag;
    },
}; //暂停标志以及改变标志的方法
var mySleep = function (t) {
    while (p_r.pause_flag) {
        sleep(500);
    }
    sleep(t);
}; //实现伪暂停
function zjmzx(fn) {
    mySleep(100);
    while (p_zjm().x == 5 && p_zjm().y == 5) {
        mySleep(500);
        console.log('正在回到主界面');
        clk(p_jxyx);
        clk(p_gbad);
        if (p_ssltk().x != 5 || p_ssltk().y != 5) {
            clk(p_ssltk, 5000);
        }
        while (!(p_gb().x == 5 && p_gb().y == 5)) {
            clk(p_gb, 2000, 0);
        }
    }
    if (fn()) {
        return true;
    } else {
        return false;
    }
} //主界面执行操作
function clk(fn, tm, count, wtf, rej, suc, j) {
    /**
     * fn返回找色条件
     * time每次点击的间隔（>1000毫秒）
     * count 点击次数
     * "wtf"是否开启等待模式，非false字符开启
     * rej失败回调
     * suc成功回调
     */
    i = 0;
    j = 0;
    let time = 0;
    var time1 = setInterval(() => {
        time++;
    }, 1000 * 60);
    var p_xh = typeof fn === 'function' ? fn() : fn; // 存储第一次调用的结果或默认值
    if (!wtf) {
        //循环点击模式
        while (p_xh.x != 5 || p_xh.y != 5) {
            count == 0 ? (i = i - 2) : null;
            x = p_xh.x;
            y = p_xh.y;
            if (suc) {
                click(x + random(-5, 5), y + random(-5, 5));
                suc();
            } else {
                click(x + random(-5, 5), y + random(-5, 5));
            }
            console.log('找到并点了一下-->' + p_xh.nm);
            tm ? mySleep(tm) : mySleep(1000);
            i++;
            if (i >= count || time > 10) {
                break;
            }
            p_xh = typeof fn === 'function' ? fn() : fn;
        }
        clearInterval(time1);
        time = 0;
        if (p_xh.x == 5 && p_xh.y == 5) {
            mySleep(1);
            console.log('没找到' + p_xh.nm);
            rej ? (rej == 1 ? null : rej()) : null;
            return false;
        }
    } else {
        /*等待模式：函数开始执行时不存在，持续找指定时间。
        等待模式与循环点击模式部分参数同参不同义。如果count==0，time是持续找的总时间（单位s，因为循环找一次sleep(1000)）
        count!=0时一直找，直到找到为止，此时time无实际意义 
        */
        function lookingFor() {
            while (p_xh.x == 5 && p_xh.y == 5) {
                count == 0 ? (j = j - 2) : null;
                console.log('waitingFor!-->' + p_xh.nm + Number(j + 1) + '/' + tm);
                mySleep(1000);
                if (j / 200 - Math.floor(j / 60) == 0) {
                    device.wakeUpIfNeeded(); //唤醒屏幕
                }
                j++;
                if (tm && j <= -tm) {
                    console.log(tm + 's没找到' + p_xh.nm + ',跳过');
                    break;
                }
                p_xh = typeof fn === 'function' ? fn() : fn;
            }
        }
        lookingFor();
        x = p_xh.x;
        y = p_xh.y;
        if (x == 5 && y == 5) {
            mySleep(100);
            if (rej) {
                //特殊情况，当rej时数字或者字符1，旋转视角后重新查找
                if (typeof rej === 'number') {
                    tm >= 5 ? (j = tm - 4) : (j = 0);
                    for (var c = 0; c < 8; c++) {
                        if (p_xh.x != 5 || p_xh.y != 5) {
                            clk(fn);
                            break;
                        } else {
                            swipe(450, 300, 700, 330, 1000);
                            p_xh = fn();
                            mySleep(1500);
                        }
                    }
                } else {
                    rej();
                }
            }
            return false;
        } else {
            if (suc) {
                //特殊情况只需要找到目标不需要点击，成功回调函数需要以n_开头
                if (suc.toString().substr(10, 10).startsWith('n_') || suc == 0) {
                    suc == 0 ? null : suc();
                    mySleep(1);
                    console.log('找到了' + p_xh.nm + '但是没有点');
                }
                //特殊情况等待目标出现后一直点击，直到消失(如果成功回调是函数，循环执行间隔8秒，如果为数字循环执行自身，间隔为suc秒)
                else if (typeof suc === 'number' || String(suc).substr(10, 10).startsWith('y_')) {
                    if (typeof suc === 'number') {
                        clk(fn, suc * 1000, 0);
                    } else {
                        clk(fn, 2000, 0);
                    }

                    typeof suc === 'number' ? null : suc();
                } else {
                    mySleep(1);
                    console.log('找到并点击了' + p_xh.nm, '成功回调ing...');
                    click(x + random(0, 5), y + random(0, 5));
                    suc();
                }
            } else {
                mySleep(1);
                console.log('找到并点击了' + p_xh.nm);
                click(x + random(0, 5), y + random(0, 5));
            }
            return true;
        }
    }
} //循环点击
function p_hd_f() {
    function huoDong() {
        clk(
            p_hd,
            1,
            0,
            'wtf',
            () => {
                swipe(500, 300, 700, 330, 1000);
                zjmzx(huoDong);
            },
            1
        );
    }
    zjmzx(huoDong);
    clk(p_hdz, 2, 0, 'wtf', p_hd_f, '0');
}
exports.p_gb = p_gb;
exports.p_hd = p_hd;
exports.p_r = p_r;
exports.p_hd_f = p_hd_f;
exports.p_bzrw = function () {
    p = images.findMultiColors(images.captureScreen(), '#E9D7AA', [
        [0, -25, '#EAD9AB'],
        [-1, 31, '#E8D6A9'],
        [-20, 5, '#EBDAAB'],
        [19, 2, '#E8D6A9'],
        [4, -16, '#676157'],
        [-5, 6, '#676157'],
        [8, 22, '#676157'],
        [-2, 16, '#6D665A'],
    ]);
    if (p) {
        return { x: p.x, y: p.y, nm: '必做任务' };
    } else {
        return { x: 5, y: 5, nm: '必做任务' };
    }
};
exports.p_cxdt = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#DD6444',
        [
            [-38, 2, '#D65334'],
            [40, 3, '#D66040'],
            [0, -30, '#FBF0DA'],
            [0, 37, '#F0E6D0'],
            [-23, -276, '#D15C2E'],
            [29, -328, '#ECDFC4'],
            [-5, -303, '#EFD6BD'],
        ],
        { threshold: 15.3 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '惩凶打图' };
    } else {
        return { x: 5, y: 5, nm: '惩凶打图' };
    }
};
exports.p_djdh = function () {
    // p = images.findMultiColors(
    //     images.captureScreen(),
    //     '#DDEFE8',
    //     [
    //         [-35, 0, '#DDEFE8'],
    //         [-48, -9, '#DDEFE8'],
    //         [181, -9, '#DDEFE8'],
    //         [212, -6, '#DDEFE8'],
    //         [177, 8, '#DDEFE8'],
    //         [210, -9, '#DDEFE8'],
    //         [76, -2, '#181515'],
    //     ],
    //     { threshold: 15.3, region: [791, 420, 474, 196] }
    // );
    p = images.findMultiColors(
        images.captureScreen(),
        '#DDEFE8',
        [
            [2, 33, '#DEF2E9'],
            [-150, -15, '#486F6E'],
            [-150, 44, '#47746F'],
            [-150, 45, '#796342'],
            [-145, 41, '#7F9992'],
            [-145, -12, '#7B9B96'],
            [160, -12, '#7B9C94'],
            [162, -12, '#4A7473'],
            [168, -12, '#365352'],
            [166, 44, '#446967'],
            [160, 41, '#7E9B97'],
            [166, 45, '#7A5F42'],
        ],
        { threshold: 25.5, region: [902, 345, 364, 241] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '点击对话' };
    } else {
        return { x: 5, y: 5, nm: '点击对话' };
    }
};
exports.p_shyh = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D86141',
        [
            [-43, -3, '#DA5030'],
            [47, -2, '#DD6444'],
            [-1, -15, '#ED6F4E'],
            [-4, 5, '#FFFDDB'],
            [27, -307, '#EBE8D7'],
            [-51, -312, '#0B0B0B'],
            [19, -266, '#96BBBB'],
        ],
        { threshold: 20 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '山河映画' };
    } else {
        return { x: 5, y: 5, nm: '山河映画' };
    }
};
exports.p_tg = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFEB9A',
        [
            [-8, -8, '#FFE88B'],
            [-9, 8, '#FFF4A7'],
            [4, -8, '#FFDE8C'],
            [3, 8, '#FFF4A7'],
            [20, -8, '#FCDE8F'],
            [20, 7, '#FBEFA8'],
        ],
        { threshold: 15.3, region: [1058, 4, 206, 81] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '跳过' };
    } else {
        return { x: 5, y: 5, nm: '跳过' };
    }
};
exports.p_qd = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFDDB',
        [
            [-16, 0, '#FFFDDB'],
            [20, 8, '#FFFDDB'],
            [-56, -16, '#E95B3A'],
            [68, 12, '#B84C2E'],
            [70, -18, '#ED6E4E'],
            [-60, 9, '#B7381D'],
        ],
        { threshold: 15.3, region: [650, 345, 402, 275] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '确定' };
    } else {
        return { x: 5, y: 5, nm: '关闭' };
    }
};
exports.p_qj = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#5A5040',
        [
            [-16, -1, '#DDCDAB'],
            [15, -8, '#E8DEBC'],
            [-31, -1, '#4C4337'],
            [28, -1, '#665A47'],
            [0, -27, '#494136'],
            [0, 19, '#665A47'],
            [-650, -301, '#E56E46'],
            [-650, -295, '#E56E46'],
            [-650, -284, '#47A1C7'],
            [-650, -278, '#47A1C7'],
            [-707, 314, '#F1E0BF'],
            [355, -233, '#F7E7C9'],
            [366, -236, '#9C947B'],
            [356, -302, '#F7E7C9'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '取景' };
    } else {
        return { x: 5, y: 5, nm: '取景' };
    }
};
exports.p_pz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#796554',
        [
            [-23, -1, '#F9F6E9'],
            [20, -8, '#EEE7C3'],
            [-2, 25, '#7D7158'],
            [2, -45, '#666053'],
            [-44, -1, '#696254'],
            [44, 21, '#877755'],
        ],
        { threshold: 20 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '拍照' };
    } else {
        return { x: 5, y: 5, nm: '拍照' };
    }
};
exports.p_tzrw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#E8D6A9',
        [
            [-1, -32, '#E8D6A9'],
            [-24, -3, '#E8D6A9'],
            [18, -3, '#E8D6A9'],
            [-2, 31, '#E8D6A9'],
            [-3, 15, '#676157'],
            [7, -15, '#676157'],
            [9, -5, '#676157'],
        ],
        { threshold: 15.3, region: [147, 630, 85, 83] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '挑战任务标签' };
    } else {
        return { x: 5, y: 5, nm: '挑战任务标签' };
    }
};
exports.p_bhyw = function () {
    p1 = images.findMultiColors(
        images.captureScreen(),
        '#D96141',
        [
            [-44, 0, '#D44B2C'],
            [36, -1, '#DA6343'],
            [-3, 5, '#FFFDDB'],
            [-8, -344, '#F9D5C3'],
            [-9, -318, '#FFDECE'],
            [-39, -305, '#B7BBA2'],
            [40, -320, '#D4D5B7'],
        ],
        { threshold: 15.3 }
    );
    p2 = images.findMultiColors(
        images.captureScreen(),
        '#D35F40',
        [
            [-6, 3, '#FFFDDB'],
            [6, 4, '#FEFCD9'],
            [21, -4, '#E9B092'],
            [-14, -4, '#FFFDDB'],
            [-31, -3, '#D55334'],
            [7, -12, '#EB6D4C'],
            [5, 14, '#C54F30'],
            [-12, -155, '#A68140'],
            [34, -153, '#E4DBD3'],
            [-2, -270, '#7D85B0'],
            [-39, -276, '#C4A39D'],
            [-39, -298, '#C2C2A7'],
            [40, -310, '#DAD7BA'],
            [23, -270, '#F5F4F6'],
        ],
        { threshold: 12.75 }
    );
    p = p1 ? p1 : p2;
    if (p) {
        return { x: p.x, y: p.y, nm: '帮会演武' };
    } else {
        return { x: 5, y: 5, nm: '帮会演武' };
    }
};
exports.p_qwtz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#DB6343',
        [
            [-20, 1, '#D86444'],
            [-57, -9, '#E85937'],
            [-66, 14, '#B7371C'],
            [30, 4, '#E6B799'],
            [62, 16, '#B94D2F'],
            [57, -13, '#ED6E4E'],
            [-26, -39, '#EADFCF'],
            [-104, -3, '#EADFCF'],
            [-8, 46, '#EADFCF'],
        ],
        { threshold: 25.5, region: [1080, 542, 195, 120] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '前往挑战' };
    } else {
        return { x: 5, y: 5, nm: '前往挑战' };
    }
};
exports.p_zdyw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#DCD3C6',
        [
            [-10, -7, '#DBD3C6'],
            [12, -5, '#D7CCBF'],
            [8, 5, '#DBD3C6'],
            [-9, 5, '#D3CBBF'],
            [-538, -21, '#E9DAA2'],
            [-688, 56, '#F1E0BF'],
            [-689, -111, '#FAEFCF'],
            [-598, -297, '#44DD88'],
            [-598, -284, '#43E494'],
            [350, -562, '#F0E2C9'],
            [379, -560, '#F7E7C9'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '自动演武' };
    } else {
        return { x: 5, y: 5, nm: '自动演武' };
    }
};
exports.p_bhrw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D25D3F',
        [
            [-60, -3, '#E87756'],
            [63, 0, '#E78463'],
            [-3, -15, '#EC6E4E'],
            [-3, 17, '#CD4F30'],
            [-9, -330, '#99F3C3'],
            [3, -302, '#31736B'],
            [-32, -334, '#F7D4CC'],
            [25, -266, '#D46B56'],
            [43, -323, '#EDBCB4'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '帮会任务' };
    } else {
        return { x: 5, y: 5, nm: '帮会任务' };
    }
};
exports.p_sbrw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFDDB',
        [
            [-55, -3, '#D75F40'],
            [64, 0, '#D25D3D'],
            [5, -21, '#EB6D4D'],
            [1, 19, '#D55D3E'],
            [-78, -271, '#C9CED8'],
            [58, -335, '#CFB285'],
            [77, -205, '#DBDDD9'],
            [-108, -284, '#5B2018'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '3倍任务' };
    } else {
        return { x: 5, y: 5, nm: '3倍任务' };
    }
};
exports.p_wbrw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#DB6343',
        [
            [-63, 1, '#D45136'],
            [62, 4, '#E97859'],
            [-3, -16, '#EB6D4D'],
            [1, 24, '#D35D3E'],
            [-16, -328, '#FFFFF9'],
            [33, -330, '#E1B654'],
            [90, -350, '#96705B'],
            [50, -292, '#996D4A'],
            [26, -218, '#BE9D78'],
            [-66, -222, '#977063'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '5倍任务' };
    } else {
        return { x: 5, y: 5, nm: '5倍任务' };
    }
};
exports.p_5brw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#082479',
        [
            [1, -11, '#8FA6EA'],
            [-11, 0, '#8BA2E5'],
            [1, 10, '#2255AA'],
            [11, 0, '#5D79C7'],
            [27, 7, '#FFFFFF'],
            [59, 3, '#DDDBD9'],
            [38, 3, '#FAFAFA'],
            [239, 2, '#DBD3C7'],
            [256, 2, '#DCD2C6'],
            [249, -8, '#DED3C8'],
        ],
        { threshold: 25.5, region: [8, 101, 320, 323] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '任务栏里的5倍任务' };
    } else {
        return { x: 5, y: 5, nm: '任务栏里的5倍任务' };
    }
};
exports.p_xxrw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#676157',
        [
            [-1, 0, '#E4D2A8'],
            [-1, -5, '#E6D4A9'],
            [5, -5, '#E9D7AC'],
            [7, -3, '#676157'],
            [11, -2, '#E9D8AC'],
            [9, 20, '#E9D8AC'],
            [5, 20, '#676157'],
            [4, 20, '#DCCCA3'],
            [0, 22, '#918771'],
            [-1, 22, '#676157'],
            [-4, 22, '#E9D7AC'],
        ],
        { threshold: 30, region: [402, 607, 140, 102] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '闲暇任务' };
    } else {
        return { x: 5, y: 5, nm: '闲暇任务' };
    }
};
exports.p_xy = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FEFBD9',
        [
            [-17, -6, '#D77459'],
            [13, -8, '#FCF3D2'],
            [32, -8, '#DD6444'],
            [-42, -8, '#D84F2F'],
            [1, -18, '#EC6E4E'],
            [-1, 11, '#C44F30'],
            [4, -269, '#8C8931'],
            [8, -347, '#96724D'],
            [-36, -332, '#5D58B8'],
            [-54, -304, '#8194B0'],
            [41, -308, '#4F471F'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '许愿' };
    } else {
        return { x: 5, y: 5, nm: '许愿' };
    }
};
exports.p_hjwl = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#80725E',
        [
            [-13, -3, '#FAF0D3'],
            [-33, -3, '#897C67'],
            [29, 5, '#FAF0D3'],
            [49, 0, '#8C806B'],
            [-63, -7, '#FAF0D3'],
            [235, -3, '#FAF0D3'],
            [-114, -14, '#5F473D'],
            [270, 8, '#5E463D'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '黄金万两' };
    } else {
        return { x: 5, y: 5, nm: '黄金万两' };
    }
};
exports.p_qwsh = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-2, 0, '#F2F1F1'],
            [-4, 0, '#433B31'],
            [-7, 0, '#F5F5F4'],
            [-9, 0, '#FFFFFF'],
            [-11, 0, '#433B31'],
            [2, 0, '#433B32'],
            [6, 0, '#433B32'],
            [8, 0, '#F4F4F4'],
            [10, 0, '#5C5852'],
            [19, 0, '#D9D8D8'],
            [25, 0, '#463F36'],
            [65, 0, '#473F35'],
            [118, 4, '#4C4338'],
            [243, 0, '#51493B'],
            [246, 0, '#F5E5AA'],
            [246, 1, '#564B3B'],
            [248, 1, '#F5E5AA'],
            [250, 0, '#52493C'],
        ],
        { threshold: 25.5, region: [330, 215, 345, 371] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '前往商会' };
    } else {
        return { x: 5, y: 5, nm: '前往商会' };
    }
};
exports.p_djgm = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFDDB',
        [
            [-17, -4, '#FDF7D5'],
            [24, 0, '#FFFCDA'],
            [-22, 1, '#CC5A3B'],
            [27, 1, '#CE5B3C'],
            [-66, 0, '#CA4628'],
            [76, -5, '#DA6242'],
            [2, -19, '#ED6F4E'],
            [2, 16, '#D25232'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '点击购买' };
    } else {
        return { x: 5, y: 5, nm: '点击购买' };
    }
};
exports.p_smrw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F8EDCC',
        [
            [-17, 0, '#FBF4D3'],
            [-25, 2, '#C65637'],
            [32, 0, '#CB593A'],
            [58, -20, '#ED6F4E'],
            [64, 16, '#D27353'],
            [8, -292, '#DEC488'],
            [-28, -335, '#CEDEE3'],
            [15, -327, '#A57D58'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '师门任务' };
    } else {
        return { x: 5, y: 5, nm: '师门任务' };
    }
};
exports.p_drfb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFDDB',
        [
            [26, -5, '#FFFDDB'],
            [-42, -8, '#DB5131'],
            [41, -7, '#DD6444'],
            [1, -44, '#FBF0D9'],
            [1, 35, '#F1E7D1'],
            [-22, -336, '#C7EAEE'],
            [10, -317, '#436B79'],
            [10, -271, '#648B9D'],
        ],
        { threshold: 12.75 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '多人副本' };
    } else {
        return { x: 5, y: 5, nm: '多人副本' };
    }
};
exports.p_cjdrfb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#CB593A',
        [
            [-4, 0, '#F8EDCC'],
            [-10, 0, '#CB593A'],
            [-13, 0, '#FBF4D2'],
            [-20, 1, '#C85739'],
            [-23, 1, '#F9EFCE'],
            [-37, -7, '#D75130'],
            [15, -2, '#D05F40'],
            [18, -4, '#FAF0CF'],
            [33, -1, '#CD5B3C'],
            [-147, -448, '#4E3C18'],
            [-148, -453, '#EDE4C2'],
            [-148, -423, '#4E3C18'],
            [-157, -352, '#E9DEB9'],
            [-161, -375, '#4E3C18'],
            [-161, -303, '#EADEB9'],
            [-161, -279, '#4E3C18'],
            [-170, -227, '#EADDB7'],
            [-166, -216, '#4E3C18'],
        ],
        { threshold: 25.5, region: [5, 60, 296, 597] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '参加多人副本' };
    } else {
        return { x: 5, y: 5, nm: '参加多人副本' };
    }
};
exports.p_jrfb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#181515',
        [
            [-113, 0, '#DDEFE8'],
            [134, -1, '#DDEFE8'],
            [-5, -15, '#DDEFE8'],
            [-1, 17, '#DEF2E9'],
        ],
        { threshold: 12.75, region: [908, 390, 355, 81] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '进入副本' };
    } else {
        return { x: 5, y: 5, nm: '进入副本' };
    }
};
exports.p_zdzz = function () {
    p1 = images.findMultiColors(
        images.captureScreen(),
        '#DCD3C6',
        [
            [-1, 12, '#DDD2C7'],
            [-11, -7, '#DBD3C6'],
            [11, -3, '#DAD2C6'],
            [-552, -33, '#E8DEAB'],
            [-699, 56, '#F1E0BF'],
            [-665, 59, '#EFDCBC'],
            [-689, -115, '#FCF3D2'],
            [-686, -66, '#FDF8E5'],
            [-628, -559, '#E56E46'],
            [-626, -553, '#E56E46'],
            [-626, -544, '#47A1C7'],
            [-626, -538, '#47A1C7'],
            [-546, -554, '#E56E46'],
            [336, -555, '#F0DFBF'],
            [263, -553, '#EEDFBF'],
            [-309, -1, '#DCD3C6'],
            [-201, 3, '#DCD3C6'],
        ],
        { threshold: 25.5 }
    );
    p2 = images.findMultiColors(
        images.captureScreen(),
        '#DCD3C6',
        [
            [-11, -4, '#D7CDC0'],
            [-11, 5, '#D3CBBE'],
            [8, 5, '#B7AFA3'],
            [8, -4, '#C0B9AD'],
            [9, -7, '#D2CBBE'],
            [-12, -7, '#DBD3C6'],
            [-14, 7, '#DAD2C6'],
            [10, 7, '#DBD3C6'],
            [0, 12, '#DDD2C7'],
            [-8, 12, '#D7CEC1'],
            [5, 12, '#D5CDC0'],
            [-627, -559, '#E56E46'],
            [-631, -540, '#47A1C7'],
            [-608, -555, '#E56E46'],
            [-606, -543, '#47A1C7'],
            [377, -492, '#F7E7C6'],
        ],
        { threshold: 25.5 }
    );
    p = storage.get('configure').zdzz_by ? p2 : p1;
    if (p) {
        return { x: p.x, y: p.y, nm: '自动作战' };
    } else {
        return { x: 5, y: 5, nm: '自动作战' };
    }
};
exports.p_xshd = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F7E7CE',
        [
            [-1, -3, '#352F2B'],
            [2, -3, '#231B1A'],
            [0, -18, '#FDF6D9'],
            [0, -22, '#F7ECD7'],
            [-12, -4, '#382D28'],
            [-20, -4, '#F4E9D3'],
            [21, -3, '#FFE3C7'],
            [-5, 14, '#EDDABB'],
            [7, 14, '#EDD8B9'],
        ],
        { threshold: 65, region: [1004, 175, 151, 149] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '限时活动' };
    } else {
        return { x: 5, y: 5, nm: '限时活动' };
    }
};
exports.p_bhyb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#4E3C18',
        [
            [-16, -1, '#F1D898'],
            [27, -1, '#F1D898'],
            [-36, 0, '#F0D797'],
            [5, -17, '#F6E6A9'],
            [-240, -3, '#584C45'],
            [-241, -17, '#BA9590'],
            [-253, -4, '#A18C98'],
            [-226, -4, '#615855'],
            [-238, 13, '#5F5D65'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '参加帮会运镖' };
    } else {
        return { x: 5, y: 5, nm: '参加帮会运镖' };
    }
};
exports.p_sxbc = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#4E3C18',
        [
            [-36, -2, '#F2DB97'],
            [-54, -2, '#EDCE71'],
            [56, 1, '#F2DB9C'],
            [68, 1, '#F2DB9D'],
            [74, -5, '#F4E0A4'],
            [69, 15, '#EDCF8C'],
            [-94, -9, '#EADFCF'],
            [-6, -32, '#EADFCF'],
            [106, -3, '#EADFCF'],
            [13, 30, '#EADFCF'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '刷新镖车' };
    } else {
        return { x: 5, y: 5, nm: '刷新镖车' };
    }
};
exports.p_ksyb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D45F3F',
        [
            [-5, 0, '#DD9074'],
            [-29, 1, '#D25D3E'],
            [-56, 0, '#D35D3F'],
            [61, -2, '#D96141'],
            [5, -18, '#ED6F4E'],
            [0, 11, '#BF5133'],
            [-14, 20, '#D35132'],
            [42, 12, '#BB4E30'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '开始运镖' };
    } else {
        return { x: 5, y: 5, nm: '开始运镖' };
    }
};
exports.p_qd = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFDDB',
        [
            [-16, 0, '#FFFDDB'],
            [20, 8, '#FFFDDB'],
            [-56, -16, '#E95B3A'],
            [68, 12, '#B84C2E'],
            [70, -18, '#ED6E4E'],
            [-60, 9, '#B7381D'],
        ],
        { threshold: 15.3, region: [650, 345, 402, 275] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '确定' };
    } else {
        return { x: 5, y: 5, nm: '确定' };
    }
};
exports.p_sldz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F2DB9B',
        [
            [-17, 5, '#6A5934'],
            [18, -1, '#4E3C18'],
            [-43, -1, '#F2DB9C'],
            [44, 3, '#F0D797'],
            [-244, -6, '#DC866E'],
            [-260, 2, '#A5B3B3'],
            [-246, 13, '#8C7D77'],
            [-233, 0, '#C57A67'],
            [-228, -8, '#E8DDD0'],
            [-256, 2, '#72898C'],
        ],
        { threshold: 25.5, region: [699, 181, 359, 311] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '参加宋辽大战' };
    } else {
        return { x: 5, y: 5, nm: '参加宋辽大战' };
    }
};
exports.p_bhps = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FBF4D2',
        [
            [-15, 0, '#D45F3F'],
            [-31, 0, '#FFFCDA'],
            [-49, 0, '#D56040'],
            [31, 6, '#C65638'],
            [-17, -17, '#ED6F4E'],
            [-20, 17, '#C94E30'],
            [-32, -322, '#877F71'],
            [6, -314, '#A49481'],
            [-15, -285, '#28231E'],
            [-43, -267, '#D9C1A1'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '帮会跑商' };
    } else {
        return { x: 5, y: 5, nm: '帮会跑商' };
    }
};
exports.p_gmsp = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#DE6545',
        [
            [-5, 0, '#FDF7D6'],
            [-9, 0, '#E27E61'],
            [-11, 0, '#FFFDDB'],
            [-13, 0, '#DE6544'],
            [-15, 0, '#FFFDDB'],
            [-17, 0, '#DF6444'],
            [-20, 0, '#FFFDDB'],
            [-23, 0, '#DB593C'],
            [9, 0, '#DF6A4B'],
            [12, 0, '#FFFDDB'],
            [14, -1, '#E06646'],
            [17, -1, '#FFFDDB'],
            [19, -1, '#FAEBCA'],
            [22, -1, '#E06646'],
        ],
        { threshold: 25.5, region: [183, 283, 460, 111] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '购买商品（跑商）' };
    } else {
        return { x: 5, y: 5, nm: '购买商品（跑商）' };
    }
};
exports.p_zd = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#A49265',
        [
            [2, 0, '#B9A574'],
            [11, 1, '#F2DB9C'],
            [18, -1, '#594825'],
            [21, 4, '#F1D898'],
            [31, -7, '#F4E2A5'],
            [34, 7, '#F0D695'],
            [-15, -7, '#F4E2A5'],
        ],
        { threshold: 25.5, region: [681, 252, 174, 127] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '最大数量' };
    } else {
        return { x: 5, y: 5, nm: '最大数量' };
    }
};
exports.p_gm = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#E29F83',
        [
            [-21, 0, '#D65E3F'],
            [-31, -10, '#E56343'],
            [-9, -15, '#E76345'],
            [29, -12, '#E76A4A'],
            [47, 3, '#D05C3D'],
            [0, 16, '#BE5032'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '购买' };
    } else {
        return { x: 5, y: 5, nm: '购买' };
    }
};
exports.p_mdd = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#CC7004',
        [
            [-8, -6, '#FFFFFF'],
            [-14, -6, '#A05407'],
            [-23, -5, '#CC7004'],
            [-23, 2, '#CC7004'],
            [-11, 2, '#914C08'],
            [-4, 2, '#A35707'],
            [18, 2, '#CC7004'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y - 10, nm: '跑商目的地' }; //可点击区域在找色区域上方，微调10
    } else {
        return { x: 5, y: 5, nm: '跑商目的地' };
    }
};
var p_rwbq = function () {
    p1 = images.findMultiColors(
        images.captureScreen(),
        '#BCB4A4',
        [
            [-1, -3, '#BCB4A4'],
            [0, -4, '#BCB4A4'],
            [1, -5, '#BDB3A3'],
            [-3, -7, '#BDB3A3'],
            [-3, -8, '#BDB3A3'],
            [-5, -8, '#BDB3A3'],
            [-5, -3, '#BDB3A3'],
            [-4, 8, '#BEB3A3'],
            [-3, 10, '#BEB3A3'],
            [2, 5, '#BBB3A3'],
            [6, 5, '#BDB3A3'],
            [10, 13, '#BBB3A3'],
            [9, 11, '#BBB3A3'],
        ],
        { threshold: 12.75, region: [3, 109, 34, 133] }
    );
    p2 = images.findMultiColors(
        images.captureScreen(),
        '#BDB3A3',
        [
            [-5, 9, '#B3A99B'],
            [-1, 7, '#BEB4A4'],
            [-1, 16, '#BEB4A4'],
            [9, 1, '#BBB1A2'],
            [4, 4, '#BCB2A2'],
            [12, 15, '#ADA496'],
            [2, 15, '#BEB4A4'],
            [12, -68, '#E56E46'],
            [12, -80, '#E56E46'],
            [25, -1, '#BEB4A4'],
            [26, -1, '#B9AFA0'],
            [20, 17, '#B5AB9C'],
            [27, 18, '#BDB3A3'],
            [35, 9, '#B8AE9F'],
        ],
        { threshold: 25.5, region: [6, 4, 277, 149] }
    );
    p = p1 ? p1 : p2;
    if (p) {
        return { x: p.x, y: p.y, nm: '任务标签' };
    } else {
        return { x: 5, y: 5, nm: '任务标签' };
    }
};
exports.p_rwbq = p_rwbq;
exports.p_hdbq = function () {
    return { x: 220, y: 130, nm: '活动标签' };
};
exports.p_lxgj = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#4E3C18',
        [
            [-5, 2, '#5D4C29'],
            [-4, 3, '#F0D99C'],
            [-4, 7, '#564421'],
            [-3, 8, '#E6CE91'],
            [1, 11, '#4E3C18'],
            [3, 16, '#D8BD7F'],
            [4, 16, '#564320'],
            [55, 0, '#594826'],
            [55, 14, '#4E3C18'],
            [55, 14, '#4E3C18'],
            [56, 15, '#E8CB8B'],
            [68, 11, '#53411E'],
            [69, 11, '#E8D090'],
            [-87, -354, '#E56E46'],
            [-87, -342, '#E56E46'],
        ],
        { threshold: 25.5, region: [4, 5, 273, 435] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '离线挂机' };
    } else {
        return { x: 5, y: 5, nm: '离线挂机' };
    }
};

exports.p_xsl = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-17, 0, '#FEFEFE'],
            [-19, 0, '#FDFDFD'],
            [-23, 0, '#FEFDFD'],
            [-25, 0, '#FFFFFF'],
            [-27, 0, '#F6F6F5'],
            [-28, 0, '#FFFFFF'],
            [-36, 0, '#FFFFFF'],
            [-39, 0, '#FFFFFF'],
            [-42, 0, '#FBFBFB'],
            [-45, 0, '#FFFFFF'],
            [-56, 0, '#EDEDEC'],
            [-57, 0, '#FFFFFF'],
            [-65, 0, '#FFFFFF'],
            [-81, 0, '#081F70'],
            [-83, 0, '#FFFFFF'],
            [-85, 0, '#142D7A'],
            [-88, 0, '#A3AFCE'],
            [-89, 0, '#1A3290'],
        ],
        { threshold: 25.5, region: [39, 135, 245, 301] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '行商路（任务）' };
    } else {
        return { x: 5, y: 5, nm: '行商路（任务）' };
    }
};
exports.p_qw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D66040',
        [
            [-10, -1, '#F3D9B9'],
            [-17, -1, '#FBF1D0'],
            [15, -2, '#FEF9D7'],
            [16, 3, '#D26B4F'],
            [-26, 6, '#C95739'],
            [-68, 0, '#D65C3C'],
            [69, 2, '#D15D3E'],
            [74, -12, '#F48E6E'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '前往' };
    } else {
        return { x: 5, y: 5, nm: '前往' };
    }
};
exports.p_cs = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D86141',
        [
            [-5, 0, '#FFFDDB'],
            [-8, 1, '#D85E3F'],
            [-10, 1, '#FFFDDB'],
            [-13, 2, '#D15538'],
            [-17, 2, '#FEFBD9'],
            [-19, 2, '#CF5639'],
            [7, 2, '#D45E3F'],
            [-11, 3, '#FFFDDB'],
            [-7, 2, '#D45E3F'],
            [9, 3, '#FFFDDB'],
            [11, 2, '#D45E3F'],
            [13, 5, '#CE5B3C'],
            [13, 7, '#FFFDDB'],
            [13, 9, '#C55537'],
            [23, 7, '#CA5839'],
            [18, -1, '#DB6F51'],
            [19, -3, '#F8E8C8'],
        ],
        { threshold: 25.5, region: [345, 174, 506, 410] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '出售' };
    } else {
        return { x: 5, y: 5, nm: '出售' };
    }
};
exports.p_dbmz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D25D3E',
        [
            [-7, 0, '#F7E9C8'],
            [-13, 1, '#E8C0A3'],
            [-24, 1, '#CF5838'],
            [11, 1, '#F4E3C3'],
            [19, -2, '#F6E5C4'],
            [45, -2, '#D66040'],
            [7, -265, '#97745A'],
            [-28, -283, '#322414'],
            [37, -306, '#D4C3BB'],
            [-23, -327, '#AF8A7A'],
            [-49, -303, '#E0D0B4'],
            [9, -292, '#7A4A37'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '参加夺宝马贼' };
    } else {
        return { x: 5, y: 5, nm: '参加夺宝马贼' };
    }
};
exports.p_mzhd = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-7, -7, '#D35740'],
            [-8, 3, '#D2553D'],
            [-5, 8, '#D2553D'],
            [6, 8, '#D35941'],
            [17, 0, '#D2573F'],
            [8, -12, '#D2563F'],
            [-8, 10, '#D35840'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '马贼红点' };
    } else {
        return { x: 5, y: 5, nm: '马贼红点' };
    }
};
exports.p_fxbq = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F4E7C8',
        [
            [-12, -19, '#F4E6C2'],
            [16, -21, '#F5E7C4'],
            [14, -42, '#F4E6C3'],
            [-12, -54, '#F4E7C5'],
            [-19, -54, '#C0AD6D'],
            [22, -58, '#C3B26D'],
            [0, -119, '#F4E7C6'],
            [11, -133, '#3A3A2A'],
        ],
        { threshold: 25.5 }[(157, 71, 1050, 480)]
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '分线标签' };
    } else {
        return { x: 5, y: 5, nm: '分线标签' };
    }
};
exports.p_djxdt = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F9E89C',
        [
            [-1106, -34, '#E56E46'],
            [-1106, -20, '#47A1C7'],
            [-1030, -34, '#E56E46'],
            [-1030, -20, '#47A1C7'],
            [-994, -34, '#E56E46'],
            [-1003, -20, '#51AACD'],
            [-963, -34, '#E77B56'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '点击小地图' };
    } else {
        return { x: 5, y: 5, nm: '点击小地图' };
    }
};
exports.p_dkxdt = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FEF1B2',
        [
            [0, -2, '#544D3E'],
            [0, -10, '#6D6451'],
            [0, 8, '#716854'],
            [12, 0, '#FEF1B2'],
            [13, 0, '#534C3E'],
            [-13, 0, '#FEF1B3'],
            [-14, 0, '#524C3D'],
            [-4, 357, '#FEF4B7'],
            [-11, 390, '#FFFFFF'],
            [-9, 401, '#3B362C'],
        ],
        { threshold: 25.5, region: [1180, 83, 83, 619] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '打开小地图' };
    } else {
        return { x: 5, y: 5, nm: '打开小地图' };
    }
};
exports.p_mztb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#74402E',
        [
            [-4, 0, '#FBA685'],
            [-7, 0, '#955742'],
            [-4, 11, '#804733'],
            [-3, -8, '#FCBDA7'],
            [-10, 11, '#EDA184'],
            [3, 12, '#EDA58B'],
            [8, -6, '#764D33'],
            [10, 4, '#744A2F'],
            [-14, -7, '#6F462C'],
            [-16, 4, '#6F462D'],
            [-3, -10, '#F4A488'],
        ],
        { threshold: 25.5, region: [161, 60, 1021, 627] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '马贼图标' };
    } else {
        return { x: 5, y: 5, nm: '马贼图标' };
    }
};
exports.p_bb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F8EFD6',
        [
            [-12, 4, '#FFFFD1'],
            [11, 4, '#FDF2D1'],
            [-18, 26, '#D9C9B2'],
            [17, 24, '#F4DEBD'],
            [1, 39, '#D9C1A1'],
            [-13, 47, '#F9F4E2'],
            [-11, 48, '#040201'],
            [-17, 51, '#060402'],
            [-6, 63, '#1C1B18'],
            [4, 48, '#070402'],
            [6, 49, '#F0EBD9'],
            [16, 60, '#FDF8E5'],
            [2, 57, '#292011'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '背包' };
    } else {
        return { x: 5, y: 5, nm: '背包' };
    }
};
exports.p_cbt = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F3E6BD',
        [
            [-9, -2, '#EEE2B6'],
            [-20, -12, '#D69569'],
            [-4, -22, '#B5AC8F'],
            [16, -14, '#D6C9A5'],
            [20, 17, '#7599CE'],
            [-33, 17, '#9D9D7C'],
            [-37, 30, '#65789A'],
            [-29, -11, '#4D6189'],
        ],
        { threshold: 25.5, region: [829, 58, 367, 499] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '藏宝图' };
    } else {
        return { x: 5, y: 5, nm: '藏宝图' };
    }
};
exports.p_sy = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#4E3C18',
        [
            [0, -2, '#F4E0A1'],
            [-5, 10, '#917E53'],
            [-7, 10, '#EFD48D'],
            [-1, 18, '#6F5C36'],
            [-1, 20, '#EDD08D'],
            [15, 17, '#4E3C18'],
            [18, 17, '#EED18F'],
            [22, 15, '#574522'],
            [24, 2, '#4E3C18'],
            [24, 0, '#F2DDA0'],
            [37, 1, '#4E3C18'],
            [38, 1, '#E5D095'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '使用' };
    } else {
        return { x: 5, y: 5, nm: '使用' };
    }
};
exports.p_djsy = function () {
    p1 =
        images.findMultiColors(
            images.captureScreen(),
            '#FFFFFE',
            [
                [-2, 0, '#6A6954'],
                [1, 0, '#E3E3E1'],
                [3, 0, '#51502F'],
                [5, 3, '#D8D8D6'],
                [6, 3, '#59583E'],
                [-2, 8, '#E1E1E0'],
                [0, 8, '#4B492F'],
                [3, 8, '#DDDDDB'],
                [-6, 13, '#FFFFFF'],
                [-8, 13, '#443A30'],
                [-4, 13, '#474230'],
                [-2, 13, '#FFFFFF'],
                [0, 13, '#494532'],
                [2, 13, '#FEFEFE'],
                [5, 13, '#5E5D4C'],
                [7, 13, '#FFFFFF'],
                [10, 13, '#49462F'],
            ],
            { threshold: 25.5, region: [463, 372, 455, 197] }
        ) ||
        images.findMultiColors(
            images.captureScreen(),
            '#FFFEFE',
            [
                [0, -1, '#726561'],
                [0, 6, '#FFFFFF'],
                [0, 8, '#57443A'],
                [0, 10, '#FFFFFF'],
                [22, 10, '#554738'],
                [21, 8, '#FEFEFE'],
                [23, 6, '#564A3B'],
                [19, 3, '#574C3D'],
                [21, 0, '#FFFFFF'],
                [36, 4, '#FFFFFE'],
                [39, -1, '#443B31'],
                [42, 0, '#FFFFFF'],
                [46, 15, '#FFFFFF'],
                [42, 9, '#FFFFFF'],
                [56, 8, '#FFFFFF'],
                [58, 3, '#574730'],
                [66, 5, '#FFFFFF'],
            ],
            { threshold: 30, region: [551, 408, 333, 182] }
        );
    p2 = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-9, 0, '#FFFFFF'],
            [-17, 3, '#FFFFFF'],
            [-31, 3, '#FFFFFF'],
            [-124, 5, '#FFEEBB'],
            [-126, 17, '#FFF6B9'],
            [-117, 17, '#FFFFD3'],
            [36, -3, '#FFFFFF'],
        ],
        { threshold: 25.5, region: [565, 410, 310, 137] }
    );
    p = p1 ? p1 : p2;
    if (p) {
        return { x: p.x, y: p.y, nm: '点击使用' };
    } else {
        return { x: 5, y: 5, nm: '点击使用' };
    }
};
exports.p_fqkq = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#4E3C18',
        [
            [-53, -14, '#F1D77F'],
            [72, -7, '#F4DFA2'],
            [-2, -22, '#F6E6AB'],
            [12, 16, '#EDD298'],
            [-260, -134, '#735638'],
            [280, -134, '#755738'],
            [195, -312, '#736E4E'],
            [-193, -315, '#303030'],
        ],
        { threshold: 25.5, region: [308, 73, 696, 625] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '放弃开启藏宝图宝箱' };
    } else {
        return { x: 5, y: 5, nm: '放弃开启藏宝图宝箱' };
    }
};
exports.p_jhll = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFCDA',
        [
            [-24, -1, '#CC482A'],
            [37, -2, '#D35F3F'],
            [6, -19, '#ED6E4E'],
            [-56, -7, '#EC7B59'],
            [-9, -155, '#A68140'],
            [45, -285, '#202D27'],
            [52, -283, '#A04D4D'],
            [-34, -284, '#90A472'],
            [-12, -350, '#819FB4'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '江湖历练' };
    } else {
        return { x: 5, y: 5, nm: '江湖历练' };
    }
};
exports.p_dgwc = function () {
    if (p) {
        return { x: p.x, y: p.y, nm: '地宫五层' };
    } else {
        return { x: 5, y: 5, nm: '地宫五层' };
    }
};
exports.p_bbml = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F2E1C0',
        [
            [-12, -20, '#FBF3F3'],
            [-13, -15, '#C7695E'],
            [-16, -15, '#C71C38'],
            [-19, -16, '#C41D33'],
            [-18, -21, '#F1D7D9'],
            [-15, -22, '#F7EEEF'],
            [-18, -25, '#D66D79'],
            [-19, -27, '#C31C34'],
            [-23, -23, '#E6B5B9'],
            [-24, -19, '#C41D33'],
            [4, -18, '#FDF4D3'],
            [-9, 12, '#E9D3B2'],
        ],
        { threshold: 25.5, region: [1103, 191, 104, 113] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '背包满了' };
    } else {
        return { x: 5, y: 5, nm: '背包满了' };
    }
};
exports.p_hcylq = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F6E7C5',
        [
            [5, 0, '#D25D3E'],
            [10, -1, '#FAF2CF'],
            [35, -1, '#D35F3F'],
            [-32, -3, '#D65A3B'],
            [0, -16, '#EC6E4E'],
            [0, 10, '#BF5032'],
            [5, -459, '#DA8798'],
            [-164, -356, '#7FD1C1'],
            [-80, -226, '#BDAE6E'],
            [94, -222, '#84AED7'],
            [174, -359, '#A7877E'],
            [200, -433, '#FBC3D7'],
            [-300, -328, '#FAF2CE'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '合成愿灵泉' };
    } else {
        return { x: 5, y: 5, nm: '合成愿灵泉' };
    }
};
exports.p_hdxtb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-73, -1, '#819BE0'],
            [-81, -1, '#002075'],
            [-83, -1, '#FFFFFF'],
            [-85, -1, '#002179'],
            [-88, -1, '#A4AECC'],
            [-89, -1, '#163082'],
            [-94, -1, '#416BBC'],
            [-83, -6, '#FFFFFF'],
            [-85, -9, '#466CC5'],
            [-85, -10, '#577DCD'],
            [-84, 8, '#2E57AD'],
        ],
        { threshold: 25.5, region: [16, 97, 279, 350] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '任务栏从上至下第一个蓝底白字活字小图标' };
    } else {
        return { x: 5, y: 5, nm: '任务栏从上至下第一个蓝底白字活字小图标' };
    }
};
exports.p_sjdt = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FEF4B7',
        [
            [3, -4, '#FEF4B7'],
            [0, -11, '#7F7C71'],
            [1, -16, '#807D73'],
            [1, -18, '#817E75'],
            [-19, -1, '#848075'],
            [23, 0, '#817E74'],
            [2, 15, '#827F75'],
            [-12, 36, '#F3F3F3'],
            [0, 35, '#F4E9E9'],
            [1, 35, '#494646'],
            [10, 32, '#FFFFFF'],
        ],
        { threshold: 25.5, region: [1176, 612, 100, 100] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '世界地图' };
    } else {
        return { x: 5, y: 5, nm: '世界地图' };
    }
};
exports.p_ly = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#60483C',
        [
            [-27, 2, '#B5BFB4'],
            [-46, 2, '#CBB990'],
            [-7, -21, '#A38262'],
            [24, -5, '#C9B064'],
            [46, 21, '#C4906D'],
            [-11, 23, '#7D6141'],
            [-18, 35, '#E0CEA8'],
            [-16, 45, '#2C2923'],
            [-10, 45, '#817862'],
            [7, 45, '#625948'],
            [13, 41, '#000000'],
            [4, 40, '#C2B498'],
        ],
        { threshold: 25.5, region: [482, 245, 280, 240] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '洛阳' };
    } else {
        return { x: 5, y: 5, nm: '洛阳' };
    }
};
exports.p_csdbz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFDF79',
        [
            [-4, 1, '#3E3A42'],
            [-8, 1, '#C7B169'],
            [-9, -1, '#423F4A'],
            [-15, -2, '#45444D'],
            [-15, -5, '#FDE17A'],
            [5, -15, '#F3D878'],
            [15, 0, '#FDE07B'],
            [24, -1, '#45454D'],
            [25, -3, '#FBE07B'],
            [37, -12, '#F9DC78'],
            [37, -9, '#4B3C45'],
            [34, -16, '#F5DD79'],
            [32, -17, '#47474F'],
        ],
        { threshold: 25.5, region: [482, 245, 280, 240] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '传送点儿标志' };
    } else {
        return { x: 5, y: 5, nm: '传送点儿标志' };
    }
};
exports.p_dg5c = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F5EFD8',
        [
            [-26, 1, '#F6F0D9'],
            [-13, -124, '#BA9E59'],
            [-22, -116, '#FFF0B3'],
            [-13, -117, '#FFF0B3'],
            [-13, 76, '#DDC796'],
            [-13, 83, '#B89F5A'],
            [156, 201, '#FFFFFF'],
            [151, 204, '#F8F1F1'],
            [154, 203, '#C44436'],
            [174, 203, '#DB3636'],
            [182, 199, '#FFFFFF'],
            [188, 193, '#E13337'],
        ],
        { threshold: 25.5, region: [166, 58, 636, 514] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '（江湖历练）地宫' };
    } else {
        return { x: 5, y: 5, nm: '（江湖历练）地宫' };
    }
};
exports.p_gm5c = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F6F0D9',
        [
            [27, 0, '#F5EFD8'],
            [13, -132, '#FFEFB2'],
            [13, -126, '#BD9C5A'],
            [13, 81, '#B9A15B'],
            [13, 87, '#D9C392'],
            [25, -44, '#FBEAB0'],
            [13, -54, '#503A20'],
            [4, 38, '#584329'],
            [-184, 192, '#49B68D'],
            [-184, 193, '#F0F6F3'],
            [-190, 204, '#49B78F'],
            [-188, 204, '#FFFFFF'],
            [-185, 210, '#4AB68D'],
            [-158, 210, '#F5F8F6'],
            [-158, 211, '#5EA885'],
            [-153, 195, '#F2F5F3'],
            [-152, 195, '#78A488'],
        ],
        { threshold: 25.5, region: [166, 58, 636, 514] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '（江湖历练）古墓' };
    } else {
        return { x: 5, y: 5, nm: '（江湖历练）古墓' };
    }
};
var p_zdgs = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#DAD2C6',
        [
            [-7, -3, '#DCD3C6'],
            [-9, 3, '#DCD3C6'],
            [-15, 9, '#DBD3C6'],
            [-9, -2, '#DCD2C5'],
            [15, -5, '#FEF3CE'],
            [25, 1, '#F1E6C3'],
            [47, -3, '#FEF3CE'],
            [47, 5, '#E5DBB9'],
        ],
        { threshold: 12.75, region: [35, 428, 132, 47] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '自动跟随' };
    } else {
        return { x: 5, y: 5, nm: '自动跟随' };
    }
};
exports.p_zdgs = p_zdgs;
exports.p_gncd = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F4E3C3',
        [
            [0, -10, '#FAEFCE'],
            [-10, -14, '#FDF2D2'],
            [-11, -19, '#FEF7DB'],
            [-26, -12, '#FBF2D2'],
            [-26, 1, '#F7E7CE'],
            [-11, 13, '#ECD8B7'],
            [-3, 10, '#EFDAB9'],
            [0, 14, '#ECD6B8'],
        ],
        { threshold: 20.4, region: [1183, 200, 80, 97] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '功能菜单' };
    } else {
        return { x: 5, y: 5, nm: '功能菜单' };
    }
};
exports.p_bhtb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F6EACD',
        [
            [0, -14, '#F8F3D9'],
            [4, -14, '#FEF7DC'],
            [-13, -12, '#FFF3D3'],
            [-7, 1, '#F3E3C3'],
            [7, -2, '#968E78'],
            [-17, -15, '#FFFFDD'],
            [14, -15, '#FFFFDD'],
            [-16, 31, '#000000'],
            [-13, 30, '#21201D'],
            [-13, 29, '#FBF6E3'],
            [11, 27, '#030301'],
            [16, 27, '#FDF8E5'],
        ],
        { threshold: 20.4, region: [1112, 283, 90, 92] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '帮会图标' };
    } else {
        return { x: 5, y: 5, nm: '帮会图标' };
    }
};
exports.p_hdbh = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F3DEA1',
        [
            [-4, 0, '#F3DEA1'],
            [-7, 0, '#DECA91'],
            [-15, 1, '#A79668'],
            [-22, 2, '#F2DD9E'],
            [-28, 3, '#EAD598'],
            [-44, 3, '#4E3C18'],
            [-59, 2, '#ECCC6C'],
            [21, 1, '#B3A171'],
            [40, 1, '#CFBC86'],
            [54, -3, '#F4E1A4'],
            [64, -10, '#F6E6AA'],
            [-7, -13, '#F6E6AB'],
            [1, 16, '#EFD292'],
        ],
        { threshold: 18, region: [1057, 622, 199, 69] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '回到帮会' };
    } else {
        return { x: 5, y: 5, nm: '回到帮会' };
    }
};
exports.p_xyzsyc = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-4, 1, '#403628'],
            [-9, 1, '#FFFFFF'],
            [-12, 2, '#403628'],
            [-16, 2, '#FFFFFF'],
            [632, 333, '#272118'],
            [631, -346, '#352E24'],
            [-515, -355, '#282119'],
            [-524, 326, '#2D281C'],
            [-339, -38, '#FFFFFF'],
            [323, -36, '#FFFFFF'],
            [143, 14, '#413628'],
            [147, 14, '#DEDEDD'],
            [141, 13, '#F9F8F8'],
            [-337, 5, '#FFFFFF'],
        ],
        { threshold: 20 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '许愿——阵势已成' };
    } else {
        return { x: 5, y: 5, nm: '许愿——阵势已成' };
    }
};
exports.p_zlqj = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#CB5A3A',
        [
            [-4, 0, '#F8EDCC'],
            [4, 0, '#FEFCD9'],
            [6, 0, '#CB593A'],
            [9, 0, '#FFFDDB'],
            [11, 0, '#CB593A'],
            [13, 0, '#F6E8C7'],
            [15, -2, '#D05E40'],
            [20, -2, '#D05D40'],
            [30, -290, '#AAAAAA'],
            [37, -285, '#6F6F76'],
            [-17, -338, '#FCFCFC'],
            [-8, -335, '#F4F4DF'],
            [-27, -282, '#E4E5E5'],
            [22, -344, '#CFD5C4'],
            [33, -350, '#AFBD96'],
            [-53, -303, '#92AB8A'],
            [13, -300, '#D3AFA6'],
        ],
        { threshold: 25.5, region: [13, 86, 1173, 517] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '珍珑棋局' };
    } else {
        return { x: 5, y: 5, nm: '珍珑棋局' };
    }
};
exports.p_bbck = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#676157',
        [
            [6, 0, '#E7DDBB'],
            [11, 0, '#676157'],
            [14, 0, '#E3D9B7'],
            [18, 0, '#726C5F'],
            [19, 0, '#D9D0AF'],
            [22, 0, '#676157'],
            [25, 0, '#D6CCAC'],
            [-8, -139, '#4E3C18'],
            [32, -174, '#4E3C18'],
        ],
        { threshold: 25.5, region: [2, 11, 140, 402] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '背包仓库' };
    } else {
        return { x: 5, y: 5, nm: '背包仓库' };
    }
};
exports.p_zdcr = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#4E3C18',
        [
            [6, 0, '#F2DA9C'],
            [10, 0, '#4E3C18'],
            [13, 0, '#F2DA9C'],
            [17, 0, '#B5A270'],
            [26, 0, '#53411E'],
            [27, 0, '#E5CF92'],
            [33, 0, '#EBD497'],
            [35, 0, '#4E3C18'],
            [37, 0, '#ECD497'],
            [41, 0, '#E0CA8F'],
            [42, 0, '#51401C'],
            [46, 0, '#F2DB9B'],
            [-28, -3, '#4E3C18'],
            [-35, -3, '#C2AE74'],
            [-38, -3, '#503E1A'],
            [-39, -3, '#F0DA9C'],
        ],
        { threshold: 25.5, region: [800, 570, 235, 133] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '自动存入仓库' };
    } else {
        return { x: 5, y: 5, nm: '自动存入仓库' };
    }
};
exports.p_qxaqs = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#5A4825',
        [
            [3, 0, '#F1D797'],
            [5, 0, '#4E3C18'],
            [8, 0, '#ECD293'],
            [12, 0, '#4E3C18'],
            [14, 0, '#F1D797'],
            [18, 0, '#F0D796'],
            [19, 0, '#503E1A'],
            [21, 0, '#C1AB75'],
            [233, -9, '#D65A3B'],
            [289, -6, '#D45E40'],
            [290, -6, '#F3DDBD'],
            [293, -6, '#D55E40'],
            [309, -6, '#D97A5E'],
            [310, -6, '#FAF1D0'],
            [313, -6, '#D45E3F'],
            [323, -6, '#FFFDDB'],
            [325, -6, '#D45F40'],
        ],
        { threshold: 25.5, region: [383, 338, 513, 199] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '取消安全锁' };
    } else {
        return { x: 5, y: 5, nm: '取消安全锁' };
    }
};
exports.p_bhyy = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#CD5B3C',
        [
            [-4, 0, '#F6E9C8'],
            [-20, 0, '#FFFDDB'],
            [-24, 0, '#CE5B3C'],
            [15, 0, '#D06C51'],
            [18, 0, '#FFFDDB'],
            [20, 0, '#CD5B3C'],
            [31, -279, '#11080C'],
            [32, -303, '#29212F'],
            [32, -332, '#655779'],
            [33, -349, '#19192C'],
            [6, -354, '#CCDAE6'],
            [-25, -318, '#463A58'],
            [-39, -282, '#BF9E9A'],
            [-18, -294, '#CCAFAA'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '帮会饮宴' };
    } else {
        return { x: 5, y: 5, nm: '帮会饮宴' };
    }
};
exports.p_ljqw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D05D3D',
        [
            [-7, -5, '#FFFDDB'],
            [-9, -5, '#DD7457'],
            [-11, -5, '#FFFDDB'],
            [-12, -5, '#DE7D60'],
            [-17, -5, '#F4DBBB'],
            [-21, -5, '#DD7A5D'],
            [-35, -4, '#E7B094'],
            [-38, -4, '#D65D3F'],
            [27, -4, '#D86444'],
            [29, -2, '#FCF5D3'],
            [-321, -3, '#4E3C18'],
            [-305, -4, '#F3DEA1'],
            [-262, -4, '#574624'],
            [161, -260, '#8D856E'],
            [160, -295, '#7A7664'],
            [160, -276, '#FFEFB1'],
            [-154, -99, '#FBF5DE'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '立即前往' };
    } else {
        return { x: 5, y: 5, nm: '立即前往' };
    }
};
exports.p_cjbhyb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#D86141',
        [
            [-10, 0, '#FDF9D7'],
            [-14, 0, '#FFFDDB'],
            [-20, 1, '#D35233'],
            [23, -272, '#A1A1A1'],
            [-6, -1, '#FFFDDB'],
            [-3, -1, '#DB6342'],
            [4, 0, '#FEF9D7'],
            [-47, -342, '#6D6BBB'],
            [16, 1, '#FAF1CF'],
            [-51, -305, '#98A295'],
            [21, 1, '#FFFDDB'],
            [24, 1, '#D66040'],
            [-22, -274, '#444046'],
            [-16, -326, '#A97779'],
            [2, -347, '#80615E'],
            [16, -336, '#BF938E'],
            [40, -294, '#827D7B'],
        ],
        { threshold: 25.5 }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '参加帮会运镖' };
    } else {
        return { x: 5, y: 5, nm: '参加帮会运镖' };
    }
};
exports.p_qx = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#4E3C18',
        [
            [-2, 0, '#F1DB9C'],
            [-6, 0, '#4E3C18'],
            [-8, 0, '#F2DB9C'],
            [-10, 0, '#4E3C18'],
            [-11, 0, '#D1BC84'],
            [3, 0, '#F1DA9B'],
            [14, 0, '#D3BE86'],
            [15, 0, '#4E3C18'],
            [18, 0, '#F2DA9C'],
            [20, 0, '#4E3C18'],
            [25, 0, '#ECD699'],
            [26, 0, '#4E3C18'],
            [28, 0, '#E4CE93'],
            [307, -3, '#FFFDDB'],
            [269, -3, '#D25334'],
            [354, 2, '#CB593A'],
        ],
        { threshold: 25.5, region: [268, 166, 724, 379] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '取消' };
    } else {
        return { x: 5, y: 5, nm: '取消' };
    }
};
exports.p_sml = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-12, -1, '#E0DFDF'],
            [-16, -1, '#FEFEFE'],
            [-21, -1, '#FEFEFE'],
            [-26, -1, '#F7F6F6'],
            [-27, -1, '#F2F2F1'],
            [-35, -1, '#FFFFFF'],
            [-46, -1, '#FCFCFC'],
            [-54, -1, '#FFFFFF'],
            [-58, -1, '#FFFFFF'],
            [-62, -1, '#E2E1DF'],
            [-64, -1, '#FFFFFE'],
            [-67, -1, '#FFFFFF'],
            [-81, -1, '#081F70'],
            [-83, -1, '#FFFFFF'],
            [-85, -1, '#142C7A'],
            [-86, -1, '#1A3580'],
            [-88, 0, '#FFFFF7'],
            [-89, -1, '#19308F'],
        ],
        { threshold: 25.5, region: [39, 135, 245, 301] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '师门令' };
    } else {
        return { x: 5, y: 5, nm: '师门令' };
    }
};
exports.p_swh = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-13, 1, '#F7F7F7'],
            [-16, 1, '#FFFFFF'],
            [-18, 1, '#FEFEFE'],
            [-20, 1, '#FEFEFE'],
            [-23, 1, '#FFFFFF'],
            [-36, 1, '#F4F4F3'],
            [-38, 1, '#F6F6F5'],
            [-41, 1, '#FEFEFE'],
            [-45, 1, '#FFFFFF'],
            [-46, 1, '#FFFFFF'],
            [-56, 1, '#FAFAFA'],
            [-60, 1, '#FFFFFF'],
            [-64, 1, '#FFFFFF'],
            [-77, 1, '#3356AA'],
            [-80, 3, '#FFFFFB'],
            [-82, 3, '#082375'],
            [-85, 3, '#FFFFFF'],
            [-87, 3, '#1E3983'],
        ],
        { threshold: 25.5, region: [39, 135, 245, 301] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '声威赫' };
    } else {
        return { x: 5, y: 5, nm: '声威赫' };
    }
};
exports.p_yh = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-14, 0, '#F6F6F6'],
            [-16, 0, '#FFFFFF'],
            [-20, 0, '#FEFEFE'],
            [-23, 0, '#FFFFFF'],
            [-35, 0, '#E9E9E8'],
            [-38, 0, '#EAEAE9'],
            [-41, 0, '#FEFEFE'],
            [-44, 0, '#FFFFFF'],
            [-46, 0, '#E6E6E5'],
            [-47, 0, '#FFFFFF'],
            [-60, 0, '#081F70'],
            [-62, 0, '#FFFFFF'],
            [-64, 0, '#142D7A'],
            [-67, 1, '#FFFFF7'],
            [-68, 0, '#1B3290'],
        ],
        { threshold: 25.5, region: [39, 135, 245, 301] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '映画' };
    } else {
        return { x: 5, y: 5, nm: '映画' };
    }
};
exports.p_cxf = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-15, 0, '#F6F6F6'],
            [-18, 0, '#FFFFFF'],
            [-21, 0, '#FFFFFF'],
            [-26, 0, '#FFFFFF'],
            [-34, 0, '#FFFFFF'],
            [-38, 0, '#F6F6F5'],
            [-41, 0, '#FDFDFD'],
            [-46, 0, '#FAFAFA'],
            [-47, 0, '#FFFFFF'],
            [-54, 0, '#EFEFEE'],
            [-67, 0, '#FDFDFD'],
            [-81, 0, '#081F70'],
            [-83, 0, '#FFFFFF'],
            [-85, 0, '#112C7A'],
            [-89, 0, '#152F8F'],
        ],
        { threshold: 25.5, region: [39, 135, 245, 301] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '惩凶匪' };
    } else {
        return { x: 5, y: 5, nm: '惩凶匪' };
    }
};
exports.p_qly = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-16, 1, '#FBFBFB'],
            [-19, 1, '#ECECEC'],
            [-22, 1, '#F7F7F7'],
            [-25, 1, '#FFFFFF'],
            [-38, 1, '#EDEDEC'],
            [-41, 1, '#FFFFFF'],
            [-45, 1, '#FDFDFD'],
            [-59, 1, '#E6E6E5'],
            [-60, 1, '#F8F8F8'],
            [-64, 1, '#FEFEFE'],
            [-77, 1, '#294A9F'],
            [-79, 1, '#DFE3EA'],
            [-82, 1, '#FFFFFB'],
            [-84, 1, '#08297B'],
            [-87, 1, '#FFFFF7'],
            [-89, 1, '#274490'],
        ],
        { threshold: 25.5, region: [39, 135, 245, 301] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '虔灵愿' };
    } else {
        return { x: 5, y: 5, nm: '虔灵愿' };
    }
};
exports.p_bdc = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-17, 0, '#EDEDEC'],
            [-20, 0, '#FFFFFF'],
            [-32, 1, '#FFFFFF'],
            [-38, 1, '#FFFFFF'],
            [-42, -1, '#FDFDFD'],
            [-47, 2, '#FEFEFE'],
            [-57, 2, '#FFFFFF'],
            [-64, 2, '#FFFFFF'],
            [-75, 2, '#4A6AB8'],
            [-78, 2, '#FFFFFF'],
            [-81, 3, '#001C71'],
            [-84, 3, '#FFFFFF'],
            [-86, 3, '#08297B'],
            [-88, 3, '#FFFFF7'],
            [-90, 3, '#203C8B'],
        ],
        { threshold: 25.5, region: [39, 135, 245, 301] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '八斗才' };
    } else {
        return { x: 5, y: 5, nm: '八斗才' };
    }
};
exports.p_bdcj = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-1, 11, '#D4CBB7'],
            [-5, 4, '#F4F2EE'],
            [8, -3, '#FDFDFC'],
            [-11, 6, '#A78F4C'],
            [11, 7, '#AA9452'],
            [-21, -14, '#FAF0D3'],
            [-21, 20, '#FDF1D3'],
            [-37, -27, '#D6BE90'],
            [-32, 35, '#D6BE90'],
            [-43, -28, '#5E463D'],
            [-44, 36, '#5E463D'],
        ],
        { threshold: 25.5, region: [829, 150, 445, 407] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '八斗才甲' };
    } else {
        return { x: 5, y: 5, nm: '八斗才甲' };
    }
};
exports.p_bwf = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFFFFF',
        [
            [-13, 1, '#FCFCFC'],
            [-21, 1, '#E2E3E1'],
            [-22, 2, '#FEFEFE'],
            [-34, 1, '#FFFFFF'],
            [-38, 1, '#F7F7F7'],
            [-41, 1, '#ECEDEC'],
            [-44, 1, '#FFFFFF'],
            [-57, 1, '#FFFFFF'],
            [-60, 1, '#FFFFFF'],
            [-62, 1, '#EFEFEE'],
            [-64, 0, '#FFFFFF'],
            [-78, 0, '#38469D'],
            [-81, 0, '#F7F8F7'],
            [-83, 0, '#FFFFFB'],
            [-85, 0, '#08297B'],
            [-88, 0, '#FFFFF7'],
            [-90, 0, '#24438F'],
        ],
        { threshold: 25.5, region: [38, 105, 252, 340] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '百物丰' };
    } else {
        return { x: 5, y: 5, nm: '百物丰' };
    }
};
exports.p_sibrw = function () {
    p1 = images.findMultiColors(
        images.captureScreen(),
        '#D25D3E',
        [
            [-2, 0, '#FBF4D2'],
            [-6, 0, '#FFFDDB'],
            [-12, 0, '#FCF5D4'],
            [-16, -1, '#D45E3F'],
            [-18, -1, '#FFFDDB'],
            [-21, -1, '#D56547'],
            [5, -1, '#FFFDDB'],
            [7, -1, '#D45E3F'],
            [9, -1, '#FFFDDB'],
            [15, -1, '#FFFDDB'],
            [18, -1, '#D66B4E'],
            [47, -231, '#B5B3B5'],
            [-76, -226, '#D2BFAE'],
            [13, -172, '#FFC694'],
            [47, -384, '#66686D'],
            [52, -140, '#FFE963'],
            [79, -137, '#271F15'],
        ],
        { threshold: 25.5 }
    ); //接取
    p2 = images.findMultiColors(
        images.captureScreen(),
        '#D25D3E',
        [
            [-4, 0, '#FFFDDB'],
            [-9, 0, '#FFFCDA'],
            [-11, 0, '#D25D3E'],
            [-14, 0, '#D98569'],
            [-19, 0, '#FFFDDB'],
            [-22, 0, '#D25D3E'],
            [5, 0, '#FFFDDB'],
            [9, 0, '#D26041'],
            [13, 0, '#F9EECD'],
            [14, 0, '#D4694C'],
            [16, 0, '#FFFDDB'],
            [18, 0, '#D25D3E'],
        ],
        { threshold: 25.5 }
    ); //继续
    p = p1 ? p1 : p2;
    if (p) {
        return { x: p.x, y: p.y, nm: '四星任务' };
    } else {
        return { x: 5, y: 5, nm: '四星任务' };
    }
};
exports.text_drfb = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#ECE4C2',
        [
            [0, 2, '#4E3C18'],
            [0, 8, '#4E3C18'],
            [0, 16, '#EBE3C0'],
            [0, 18, '#4E3C18'],
            [0, 73, '#E9DFBB'],
            [0, 76, '#4E3C18'],
            [0, 93, '#4E3C18'],
            [0, 134, '#EBE1BC'],
            [0, 137, '#4E3C18'],
            [0, 181, '#4E3C18'],
            [0, 183, '#E9DDB7'],
            [0, 216, '#EBDFBB'],
            [0, 219, '#4E3C18'],
            [0, 234, '#4E3C18'],
            [0, 250, '#EBDFB9'],
            [4, 238, '#E8DAB6'],
        ],
        { threshold: 25.5, region: [3, 59, 107, 379] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '多人副本字' };
    } else {
        return { x: 5, y: 5, nm: '多人副本字' };
    }
};
exports.p_cjdw = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#5E4D2A',
        [
            [-12, 0, '#D4BE86'],
            [-13, 0, '#4E3C18'],
            [-24, 0, '#4E3C18'],
            [-26, 0, '#F1D99A'],
            [-37, 0, '#4E3C18'],
            [-43, 0, '#EBC76B'],
            [9, -2, '#4E3C18'],
            [11, -4, '#F2DD9F'],
            [18, -4, '#4E3C18'],
            [20, -4, '#F3DD9F'],
            [33, -3, '#EFD89B'],
            [35, -3, '#4E3C18'],
            [46, -1, '#4E3C18'],
            [53, 0, '#F2DA9A'],
            [-200, -6, '#4E3C18'],
            [-198, -6, '#F3DFA2'],
            [173, -5, '#FFFDDB'],
            [175, -5, '#DA6141'],
        ],
        { threshold: 25.5, region: [498, 569, 572, 69] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '创建队伍' };
    } else {
        return { x: 5, y: 5, nm: '创建队伍' };
    }
};
var p_dwbq = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#BDB5A5',
        [
            [-6, -19, '#BCB4A4'],
            [-2, -20, '#BDB3A3'],
            [6, -20, '#BDB2A2'],
            [0, -10, '#BCB2A2'],
            [10, -14, '#BDB1A1'],
            [-13, -71, '#E0BF7E'],
            [17, -71, '#DAAD6A'],
            [5, -122, '#E8CF90'],
            [4, -124, '#6A4D32'],
            [9, -124, '#6A4D32'],
            [-5, -146, '#6A4D32'],
            [-5, -148, '#EED99B'],
        ],
        { threshold: 25.5, region: [1, 106, 42, 279] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '队伍标签' };
    } else {
        return { x: 5, y: 5, nm: '队伍标签' };
    }
};
exports.p_dwbq = p_dwbq;
var p_dwxx = function () {
    队长 = images.findMultiColors(
        images.captureScreen(),
        '#CE4A42',
        [
            [0, 1, '#F7D67B'],
            [0, 10, '#EBB96A'],
            [0, 12, '#AE363C'],
            [6, 9, '#ECB868'],
            [1, 7, '#AD3D36'],
            [1, 3, '#BD4A42'],
            [22, 25, '#E56E46'],
        ],
        { threshold: 25.5, region: [50, 5, 70, 70] }
    );
    队员1 =
        images.findMultiColors(
            images.captureScreen(),
            '#FFFFFF',
            [
                [-3, 7, '#B2452C'],
                [-3, 14, '#B2442B'],
            ],
            { threshold: 25.5, region: [94, 105, 184, 56] }
        ) ||
        images.findMultiColors(
            images.captureScreen(),
            '#793324',
            [
                [0, 7, '#793223'],
                [79, 7, '#793223'],
                [79, 0, '#793324'],
                [154, 0, '#793324'],
                [154, 7, '#793223'],
            ],
            { threshold: 25.5, region: [94, 105, 184, 56] }
        );
    队员1跟随 = images.findMultiColors(
        images.captureScreen(),
        '#60BEDA',
        [
            [-6, 0, '#69D2EC'],
            [6, 0, '#74D1FF'],
            [5, -6, '#73EFFF'],
            [-6, -5, '#6DFFFF'],
            [-7, 5, '#66CCFF'],
            [8, 5, '#66BAEC'],
        ],
        { threshold: 25.5, region: [94, 105, 184, 56] }
    );
    队员2 =
        images.findMultiColors(
            images.captureScreen(),
            '#FFFFFF',
            [
                [-3, 7, '#B2452C'],
                [-3, 14, '#B2442B'],
            ],
            { threshold: 25.5, region: [94, 160, 184, 56] }
        ) ||
        images.findMultiColors(
            images.captureScreen(),
            '#793324',
            [
                [0, 7, '#793223'],
                [79, 7, '#793223'],
                [79, 0, '#793324'],
                [154, 0, '#793324'],
                [154, 7, '#793223'],
            ],
            { threshold: 25.5, region: [94, 160, 184, 56] }
        );
    队员2跟随 = images.findMultiColors(
        images.captureScreen(),
        '#60BEDA',
        [
            [-6, 0, '#69D2EC'],
            [6, 0, '#74D1FF'],
            [5, -6, '#73EFFF'],
            [-6, -5, '#6DFFFF'],
            [-7, 5, '#66CCFF'],
            [8, 5, '#66BAEC'],
        ],
        { threshold: 25.5, region: [94, 160, 184, 56] }
    );
    队员3 =
        images.findMultiColors(
            images.captureScreen(),
            '#FFFFFF',
            [
                [-3, 7, '#B2452C'],
                [-3, 14, '#B2442B'],
            ],
            { threshold: 25.5, region: [94, 215, 184, 56] }
        ) ||
        images.findMultiColors(
            images.captureScreen(),
            '#793324',
            [
                [0, 7, '#793223'],
                [79, 7, '#793223'],
                [79, 0, '#793324'],
                [154, 0, '#793324'],
                [154, 7, '#793223'],
            ],
            { threshold: 25.5, region: [94, 215, 184, 56] }
        );
    队员3跟随 = images.findMultiColors(
        images.captureScreen(),
        '#60BEDA',
        [
            [-6, 0, '#69D2EC'],
            [6, 0, '#74D1FF'],
            [5, -6, '#73EFFF'],
            [-6, -5, '#6DFFFF'],
            [-7, 5, '#66CCFF'],
            [8, 5, '#66BAEC'],
        ],
        { threshold: 25.5, region: [94, 215, 184, 56] }
    );
    队员4 =
        images.findMultiColors(
            images.captureScreen(),
            '#FFFFFF',
            [
                [-3, 7, '#B2452C'],
                [-3, 14, '#B2442B'],
            ],
            { threshold: 25.5, region: [94, 270, 184, 56] }
        ) ||
        images.findMultiColors(
            images.captureScreen(),
            '#793324',
            [
                [0, 7, '#793223'],
                [79, 7, '#793223'],
                [79, 0, '#793324'],
                [154, 0, '#793324'],
                [154, 7, '#793223'],
            ],
            { threshold: 25.5, region: [94, 270, 184, 56] }
        );
    队员4跟随 = images.findMultiColors(
        images.captureScreen(),
        '#60BEDA',
        [
            [-6, 0, '#69D2EC'],
            [6, 0, '#74D1FF'],
            [5, -6, '#73EFFF'],
            [-6, -5, '#6DFFFF'],
            [-7, 5, '#66CCFF'],
            [8, 5, '#66BAEC'],
        ],
        { threshold: 25.5, region: [94, 270, 184, 56] }
    );
    队员5 =
        images.findMultiColors(
            images.captureScreen(),
            '#FFFFFF',
            [
                [-3, 7, '#B2452C'],
                [-3, 14, '#B2442B'],
            ],
            { threshold: 25.5, region: [94, 325, 184, 56] }
        ) ||
        images.findMultiColors(
            images.captureScreen(),
            '#793324',
            [
                [0, 7, '#793223'],
                [79, 7, '#793223'],
                [79, 0, '#793324'],
                [154, 0, '#793324'],
                [154, 7, '#793223'],
            ],
            { threshold: 25.5, region: [94, 325, 184, 56] }
        );
    队员5跟随 = images.findMultiColors(
        images.captureScreen(),
        '#60BEDA',
        [
            [-6, 0, '#69D2EC'],
            [6, 0, '#74D1FF'],
            [5, -6, '#73EFFF'],
            [-6, -5, '#6DFFFF'],
            [-7, 5, '#66CCFF'],
            [8, 5, '#66BAEC'],
        ],
        { threshold: 25.5, region: [94, 325, 184, 56] }
    );
    队员6 =
        images.findMultiColors(
            images.captureScreen(),
            '#FFFFFF',
            [
                [-3, 7, '#B2452C'],
                [-3, 14, '#B2442B'],
            ],
            { threshold: 25.5, region: [94, 380, 184, 56] }
        ) ||
        images.findMultiColors(
            images.captureScreen(),
            '#793324',
            [
                [0, 7, '#793223'],
                [79, 7, '#793223'],
                [79, 0, '#793324'],
                [154, 0, '#793324'],
                [154, 7, '#793223'],
            ],
            { threshold: 25.5, region: [94, 380, 184, 56] }
        );
    队员6跟随 = images.findMultiColors(
        images.captureScreen(),
        '#60BEDA',
        [
            [-6, 0, '#69D2EC'],
            [6, 0, '#74D1FF'],
            [5, -6, '#73EFFF'],
            [-6, -5, '#6DFFFF'],
            [-7, 5, '#66CCFF'],
            [8, 5, '#66BAEC'],
        ],
        { threshold: 25.5, region: [94, 380, 184, 56] }
    );
    var desc = {
        dz: Boolean(队长),
        dy1: {
            yw: Boolean(队员1),
            gs: Boolean(队员1跟随),
            is_gs: Boolean(Boolean(队员1) == Boolean(队员1跟随)),
        },
        dy2: {
            yw: Boolean(队员2),
            gs: Boolean(队员2跟随),
            is_gs: Boolean(Boolean(队员2) == Boolean(队员2跟随)),
        },
        dy3: {
            yw: Boolean(队员3),
            gs: Boolean(队员3跟随),
            is_gs: Boolean(Boolean(队员3) == Boolean(队员3跟随)),
        },
        dy4: {
            yw: Boolean(队员4),
            gs: Boolean(队员4跟随),
            is_gs: Boolean(Boolean(队员4) == Boolean(队员4跟随)),
        },
        dy5: {
            yw: Boolean(队员5),
            gs: Boolean(队员5跟随),
            is_gs: Boolean(Boolean(队员5) == Boolean(队员5跟随)),
        },
        dy6: {
            yw: Boolean(队员6),
            gs: Boolean(队员6跟随),
            is_gs: Boolean(Boolean(队员6) == Boolean(队员6跟随)),
        },
        is_gs:
            Boolean(Boolean(队员1) == Boolean(队员1跟随)) &&
            Boolean(Boolean(队员2) == Boolean(队员2跟随)) &&
            Boolean(Boolean(队员3) == Boolean(队员3跟随)) &&
            Boolean(Boolean(队员4) == Boolean(队员4跟随)) &&
            Boolean(Boolean(队员5) == Boolean(队员5跟随)) &&
            Boolean(Boolean(队员6) == Boolean(队员6跟随)),
    };
    p = 队长;
    if (p) {
        return {
            x: p.x,
            y: p.y,
            nm: '队伍信息',
            desc,
        };
    } else {
        return {
            x: 5,
            y: 5,
            nm: '队伍信息',
            desc,
        };
    }
}; //队伍信息
exports.p_dwxx = p_dwxx;
exports.p_ssltk = p_ssltk;
var p_dzbq = function () {
    //打开队伍界面后的一号位的较大的队长标签
    p = images.findMultiColors(
        images.captureScreen(),
        '#BE3427',
        [
            [0, -7, '#F7DB77'],
            [0, -17, '#B02B1E'],
            [0, -31, '#88271C'],
            [0, -35, '#BD3028'],
            [0, 9, '#FDE67F'],
            [0, 10, '#C7703F'],
            [0, 11, '#F1CB70'],
            [0, 16, '#BC452D'],
            [0, 18, '#F9DB78'],
            [0, 19, '#B9432A'],
            [0, 35, '#88271C'],
            [0, 39, '#B43022'],
        ],
        { threshold: 25.5, region: [146, 110, 62, 99] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '队长标签' };
    } else {
        return { x: 5, y: 5, nm: '队长标签' };
    }
};
exports.p_dzbq = p_dzbq;
var p_sqdz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#5E4D2A',
        [
            [3, 0, '#F2DB9B'],
            [6, 0, '#4E3C18'],
            [15, 0, '#4E3C18'],
            [17, 0, '#D3BE85'],
            [32, 0, '#F2DB9B'],
            [34, 0, '#4E3C18'],
            [38, 0, '#F1DA9B'],
            [44, 1, '#4E3C18'],
            [46, 10, '#4E3C18'],
            [-3, 10, '#DDC385'],
            [-4, 10, '#4E3C18'],
            [-6, 10, '#E7CB8B'],
            [-16, 3, '#4E3C18'],
            [-29, 2, '#4E3C18'],
            [-33, 3, '#F0D691'],
            [-35, 3, '#4E3C18'],
            [-40, 3, '#4E3C18'],
            [-42, 3, '#EED080'],
        ],
        { threshold: 25.5, region: [174, 122, 139, 59] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '申请队长' };
    } else {
        return { x: 5, y: 5, nm: '申请队长' };
    }
};
exports.p_sqdz = p_sqdz;
exports.p_wdwz = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#CCFF66',
        [
            [-1, 0, '#CCFF66'],
            [-7, -10, '#B5F76B'],
            [6, -10, '#B5F76B'],
            [-1, -14, '#B0F669'],
            [0, -25, '#9EF068'],
            [0, -38, '#89DC5B'],
            [-13, -24, '#9CEF6B'],
            [12, -24, '#A1F26B'],
        ],
        { threshold: 25.5, region: [142, 60, 1084, 534] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '我的位置(跑商)' };
    } else {
        return { x: 5, y: 5, nm: '我的位置(跑商)' };
    }
};
var p_jxyx = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#F2DEA1',
        [
            [-6, 1, '#6B5B37'],
            [-11, 2, '#928157'],
            [-32, 3, '#564422'],
            [-42, 0, '#96865C'],
            [21, 4, '#4E3C18'],
            [14, -2, '#51401D'],
            [47, 1, '#F3DD9F'],
        ],
        { threshold: 25.5, region: [403, 439, 181, 80] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '继续游戏' };
    } else {
        return { x: 5, y: 5, nm: '继续游戏' };
    }
};
exports.p_jxyx = p_jxyx;

var p_gbad = function () {
    p = images.findMultiColors(
        images.captureScreen(),
        '#FFF0EC',
        [
            [-8, -8, '#FFF0EC'],
            [-13, -12, '#CE3318'],
            [8, -7, '#FBE1DC'],
            [8, -12, '#CE3318'],
            [8, 6, '#FFF0EC'],
            [7, 10, '#DA432F'],
            [-7, 7, '#FFF0EC'],
            [-9, 13, '#DB4531'],
        ],
        { threshold: 25.5, region: [1154, 62, 78, 68] }
    );
    if (p) {
        return { x: p.x, y: p.y, nm: '关闭广告' };
    } else {
        return { x: 5, y: 5, nm: '关闭广告' };
    }
};
exports.p_gbad = p_gbad;
//ORC找点
exports.orc_cd = function () {
    var a = 1,
        b = 1;

    p = findText('莱单', [1199 * a, 249 * b, 77 * a, 45 * b], 'e');
    if (p) {
        return { x: p[0].x * a, y: p[0].y * b - 30, nm: p[0].text };
    } else {
        return { x: 5, y: 5, nm: '菜单' };
    }
};
exports.orc_sz = function () {
    var a = 1,
        b = 1;
    p = findText('设置', [1045 * a, 656 * b, 72 * a, 41 * b], 'e');
    if (p) {
        return { x: p[0].x * a, y: p[0].y * b - 30, nm: '设置' };
    } else {
        return { x: 5, y: 5, nm: '设置' };
    }
};
exports.orc_qhjs = function () {
    var a = 1,
        b = 1;
    p = findText('切换角色', [875 * a, 274 * b, 109 * a, 31 * b], 'e');
    if (p) {
        return { x: p[0].x * a, y: p[0].y * b, nm: '切换角色' };
    } else {
        return { x: 5, y: 5, nm: '切换角色' };
    }
};
exports.orc_role = function () {
    var a = 1,
        b = 1;
    p = findText(ui.roleName.getText(), [7 * a, 602 * b, 747 * a, 106 * b], 'c');
    if (p) {
        return { x: p[0].x * a, y: p[0].y * b, nm: p[0].text };
    } else {
        return { x: 5, y: 5, nm: ui.roleName.getText() };
    }
};
exports.orc_jr = function () {
    var a = 1,
        b = 1;
    p = findText('进入', [1017 * a, 645 * b, 146 * a, 46 * b], 'e');
    if (p) {
        return { x: p[0].x * a, y: p[0].y * b, nm: '进入游戏' };
    } else {
        return { x: 5, y: 5, nm: '进入游戏' };
    }
};

exports.clk = clk;
exports.zjmzx = zjmzx;
exports.checkHandle = function (eve, ele, sta_fin) {
    return new Promise((resolve, reject) => {
        var uId = ele.toString().split(' ')[0].split('{')[1];
        u_preset_year = 'preset_year_' + uId;
        u_preset_month = 'preset_month_' + uId;
        u_preset_day = 'preset_day_' + uId;
        u_preset_hour = 'preset_hour_' + uId;
        u_preset_minute = 'preset_minute_' + uId;
        u_preset_time = 'preset_time_' + uId;
        u_ms = 'ms_' + uId;
        //定时器函数
        var setTimer = function (eve, ele) {
            var uId = ele.toString().split(' ')[0].split('{')[1];
            if (!variables.timers) {
                variables.timers = {};
            }
            xx++;
            variables.timer_threads[uId] = threads.start(() => {
                variables.timers[uId] = setInterval(function () {
                    var t = variables['preset_time_' + uId] - new Date().getTime();
                    h =
                        String(Math.floor(t / 1000 / 60 / 60)).length < 2
                            ? '0' + Math.floor(t / 1000 / 60 / 60)
                            : Math.floor(t / 1000 / 60 / 60);
                    m =
                        String(Math.floor((t % 3600000) / 60000)).length < 2
                            ? '0' + Math.floor((t % 3600000) / 60000)
                            : Math.floor((t % 3600000) / 60000);
                    s =
                        String(Math.floor((t % 60000) / 1000)).length < 2
                            ? '0' + Math.floor((t % 60000) / 1000)
                            : Math.floor((t % 60000) / 1000);
                    ui.run(() => {
                        sta_fin == 'sta'
                            ? ele.setText(h + ':' + m + ':' + s + '后执行')
                            : ele.setText(h + ':' + m + ':' + s + '后结束');
                    });
                    if (Math.floor(t / 1000) <= -1) {
                        clearTimer(uId);
                        ui.run(() => {
                            sta_fin == 'sta' ? ele.setText('正在执行') : ele.setText('已经结束');
                        });
                    }
                }, 1000);
            });
        };
        // 清除定时器函数
        var clearTimer = function (uId) {
            if (variables.timers && variables.timers[uId]) {
                variables.timer_threads[uId].clearInterval(variables.timers[uId]);
                variables.timer_threads[uId].interrupt();
                delete variables.timers[uId];
                delete variables.timer_threads[uId];
            }
        };
        threads.start(function () {
            if (eve) {
                sz = ui.inflate(
                    <vertical gravity="center">
                        <text text="请选择必做任务开始时间" />
                        <datepicker id="rq1" datePickerMode="spinner" />
                        <timepicker id="sj1" timePickerMode="spinner" hourFormat="24" />
                        <button text="确定" id="qd1" layout_gravity="center" />
                    </vertical>
                );
                ui.setContentView(sz);
                sz.qd1.on('click', () => {
                    ui.setContentView(layout1);
                    variables[u_preset_year] = sz.rq1.getYear() ? sz.rq1.getYear() : variables[u_preset_year];
                    variables[u_preset_month] = sz.rq1.getMonth();
                    variables[u_preset_day] = sz.rq1.getDayOfMonth();
                    variables[u_preset_hour] = sz.sj1.getHour();
                    variables[u_preset_minute] = sz.sj1.getMinute();
                    variables[u_preset_time] = new Date(
                        variables[u_preset_year],
                        variables[u_preset_month],
                        variables[u_preset_day],
                        variables[u_preset_hour],
                        variables[u_preset_minute],
                        0
                    );
                    present_time = new Date();
                    variables[u_ms] = variables[u_preset_time].getTime() - present_time.getTime();
                    if (variables[u_ms] < 1000) {
                        toastLog('请至少选择1分钟之后的时间点');
                        resolve(null);
                        return false;
                    }
                    setTimer(eve, ele);
                    resolve(variables[u_ms]);
                });
            } else {
                clearTimer(uId);
                ui.run(() => {
                    sta_fin == 'sta' ? ele.setText('定时开始') : ele.setText('定时结束');
                });
                resolve(null);
            }
        });
    });
}; //定时开始与结束多选框操作
exports.planToDo = function (dsks, dsjs, do_what, a0, start_Time, finish_Time, s_timer, finish_thread, f_timer) {
    //定时开始
    dsks.on('check', (eve, ele) => {
        var uId = ele.toString().split(' ')[0].split('{')[1];
        checkHandle(eve, ele, 'sta').then(result => {
            start_Time = result;
            if (start_Time) {
                if (variables.threads[a0]) {
                    try {
                        s_timer ? variables.threads[a0].clearTimeout(s_timer) : null;
                        variables.threads[a0].interrupt();
                        delete variables.threads[a0];
                    } catch (error) {
                        console.log(error);
                    }
                }
                variables.threads[a0] = threads.start(function () {
                    s_timer = setTimeout(function () {
                        let index0 = Object.keys(variables.threads).indexOf(a0);
                        Object.keys(variables.threads)
                            .slice(0, index0 + 1)
                            .forEach((e, index) => {
                                if (e != a0) {
                                    variables.threads[e].interrupt();
                                }
                            });
                        sleep(1000);
                        b1
                            ? null
                            : (b1 = threads.start(function () {
                                  w = require('./floatyWindow.js').window;
                              }));
                        do_what();
                    }, start_Time);
                });
            } else {
                variables.threads[a0].clearTimeout(s_timer);
                variables.threads[a0].interrupt();
                delete variables.threads[a0];
            }
        });
    });
    //定时结束
    dsjs.on('check', (eve, ele) => {
        checkHandle(eve, ele, 'fin').then(result => {
            finish_Time = result;
            if (finish_Time) {
                finish_thread = threads.start(function () {
                    f_timer = setTimeout(function () {
                        try {
                            if (a0 && a0.isAlive()) {
                                a0.clearTimeout(s_timer);
                                a0.interrupt();
                            }
                        } catch (error) {
                            log('error=' + error);
                        }
                    }, finish_Time);
                });
            } else {
                finish_thread.clearTimeout(f_timer);
                finish_thread.interrupt();
            }
        });
    });
}; //定时开始与结束任务
var findText = function (txt, region, e_c) {
    try {
        region = region ? region : [0, 0, device.height, device.width];
        img_big = images.captureScreen();
        img = images.clip(img_big, region[0], region[1], region[2], region[3]);
        // OCR 接口链接
        var url = storage.get('configure').ip_ORC + '/api/ocr';
        // 获取图片的 Base64 编码
        var b64 = images.toBase64(img);
        // 发送 HTTP POST 请求
        var response = http.postJson(url, {
            base64: b64,
        });
        var res = response.body.json();
        // 处理响应
        if (res.code == 100) {
            result = res.data;
            equal = [];
            contain = [];
            result.map((itm, idx) => {
                if (txt && itm.text == txt) {
                    equal.push({
                        text: itm.text,
                        x: Number(region[0] + (Number(itm.box[1][0]) + Number(itm.box[0][0])) / 2).toFixed(0),
                        y: Number(region[1] + (Number(itm.box[2][1]) + Number(itm.box[0][1])) / 2).toFixed(0),
                    });
                }
                if (txt && itm.text.indexOf(txt) != -1) {
                    contain.push({
                        text: itm.text,
                        x: Number(region[0] + (Number(itm.box[1][0]) + Number(itm.box[0][0])) / 2).toFixed(0),
                        y: Number(region[1] + (Number(itm.box[2][1]) + Number(itm.box[0][1])) / 2).toFixed(0),
                    });
                }
                // log('result', result);
                // log('equal', itm.text, txt, equal);
                // log('contain', itm.text.indexOf(txt), contain);
            });
            if (txt && e_c == 'e') {
                if (equal.length != 0) {
                    console.log('找到' + txt);
                    return equal;
                } else {
                    console.log('没找到' + txt);
                    return null;
                }
            } else if (txt && (e_c == 'c' || !e_c)) {
                if (contain.length != 0) {
                    console.log('找到包含"' + txt + '"的字段');
                    return contain;
                } else {
                    console.log('没找到包含"' + txt + '"的字段');
                    return null;
                }
            } else {
                region
                    ? console.log(
                          '全屏截图在' +
                              '(' +
                              region[0] +
                              ',' +
                              region[1] +
                              ',' +
                              region[2] +
                              ',' +
                              region[3] +
                              ')范围内的内容已返回'
                      )
                    : console.log('全屏截图内容已返回');
                return result;
            }
        } else if (res.code == 300) {
            console.log('base64解码失败！');
            return false;
        } else if (res.code == 101) {
            console.log('没有识别到文字！');
            return false;
        } else {
            console.log('识别失败，请检查res报错');
            return false;
        }
    } catch (error) {
        log('文字识别出错了' + error);
    }
}; //依赖ORC找字
exports.findText = findText;

exports.is_dz = function is_dz(fn) {
    var gsdd = 0;
    zjmzx(() => {
        //如果是队长组队跟随，成功后进入副本
        if (p_dwxx().x != 5 || p_dwxx().y != 5) {
            function gspd() {
                clk(p_zdgs, 2, 0, 'wtf', null, 1);
                clk(p_dwbq);
                while (!p_dwxx().desc.is_gs) {
                    gsdd++;
                    sleep(1000);
                    if (gsdd >= 30) {
                        click(100 + random(-5, 5), 450 + random(-5, 5));
                        gspd();
                        break;
                    }
                }
            }
            gspd();
            typeof fn === 'function' ? fn() : log(fn.toString());
        } else {
            //如果不是队长，申请队长后发起组队跟随
            while (p_rwbq().x != 5 || p_dwbq().x != 5) {
                click(25 + random(-5, 5), 320 + random(-5, 5));
            }
            clk(p_dzbq, 2, 0, 'wtf', null, () => {
                clk(p_dzbq, 2000);
                clk(p_sqdz, 5, 0, 'wtf', null, () => {
                    clk(p_sqdz, 2000);
                    sleep(15000);
                    is_dz();
                });
            });
        }
    });
};
